package cn.gov.pbc.dream.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class BankFinancingProductRaiseInfoConst {

    @AllArgsConstructor
    @Getter
    public enum CustomerType {
        COMPANY(1, "单位"),
        PERSON(2, "个人"),
        HOUSEHOLD_SECTOR(4, "住户"),
        GOVERNMENT(5, "广义政府"),
        NON_FINANCIAL_COMPANY(6, "非金融企业"),
        FINANCIAL_COMPANY(7, "金融机构（实体）"),
        SPECIAL_PURPOSE_VEHICLE(8, "特定目的载体"),
        FOREIGN_SECTOR(9, "境外");
        private int code;
        private String value;

        public static BankFinancingProductRaiseInfoConst.CustomerType codeOf(int code) {
            for (BankFinancingProductRaiseInfoConst.CustomerType customerType : values()) {
                if (customerType.getCode() == code) {
                    return customerType;
                }
            }
            return null;
        }
    }
}
